package cn.itsource.order.controller;


import cn.itsource.basic.util.AjaxResult;
import cn.itsource.order.domain.OrderAdoptDto;
import cn.itsource.order.service.IOrderAdoptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


@Controller
@Slf4j
@RequestMapping("adoptOrder")
public class OrderAdoptController {
    @Autowired
    private IOrderAdoptService orderAdoptService;

    /**
     * 提交订单
     * 订单生成成功,就是支付页面
     * @param dto
     * @return
     */
    @PostMapping("/submitOrder")
    @ResponseBody
    public AjaxResult submitOrder(@RequestBody @Valid OrderAdoptDto dto){
        //下单
        return orderAdoptService.submitOrder(dto);
    }
}
